{include file="../../../application/admin/view/public/head" /}
<div class="page-container p10">

    <div class="my-toolbar-box" >
        <div class="center mb10">
            <form class="layui-form " action="{:url()}"  method="post">
                <div class="layui-form-item" style="display: inline-flex;justify-content: center">
                    <input class="layui-input w300"  name="keywords" placeholder="请输入要查询设备ID或者设备名称" value="{$param.keywords|default=''}" />
                </div>
                <input type="hidden" name="setType" value="{$param.setType}">
                <div class="layui-input-inline clear">
                    <select class="layui-select" name="app_id">
                        <option value="">全部</option>
                        {foreach $applists as $appId =>$appName}
                                <option value="{$appId}"
                                        {if $appId == $param.app_id}
                                            selected
                                        {/if}
                                >{$appName}</option>

                        {/foreach}
                    </select>
                </div>

                <button class="layui-btn mgl-20 j-search" >查询</button>

            </form>
        </div>
    </div>

     <form class="layui-form " method="post" id="pageListForm">
         <table class="layui-table" lay-size="sm">
            <thead>
            <tr>
                <th width="180">应用名称</th>
                <th width="320">设备号</th>
                <th width="100">系统类型</th>
                <th >设备名称</th>
                <th >设备模型</th>
                <th width="100">首次访问</th>
                <th width="100">最后访问</th>
                <th width="100">操作</th>
            </tr>
            </thead>

            {volist name="list" id="vo"}
            <tr>
                <td>{$vo.app_name}[{$vo.app_id}]</td>
                <td>{$vo.device_id}</td>
                <td>{$vo.system_type}</td>
                <td>{$vo.device_name}</td>
                <td>{$vo.device_model}</td>
                <td>{$vo.time_added|mac_day=color}</td>
                <td>{$vo.time_updated|mac_day=color}</td>
                <td>
                    <a data-full="1" data-href="{:url('devicelog')}?device_id={$vo.device_id}&app_id={$vo.app_id}" class="layui-badge-rim j-iframe" href="javascript:vod(0);"> 观影记录 </a>
<!--                    <a data-full="1" data-2333-href="{:url('adindex')}?device_id={$vo.device_id}" class="layui-badge-rim j-iframe" href="javascript:alert('尚未完成');"> 广告记录 </a>-->
<!--                    {if $vo.is_need_updated ===1}-->
<!--                    <a class="layui-badge-rim j-ajax  layui-bg-orange" confirm="确认关闭升级提示吗？" data-href="{:url('updatedevice?app_id='.$vo['app_id'].'&device_id='.$vo['device_id'].'&settype=0')}" href="javascript:;" title="关闭升级提示">关闭升级提示</a>-->
<!--                    {else/}-->
<!--                    <a class="layui-badge-rim j-ajax" confirm="确认开启升级提示吗？" data-href="{:url('updatedevice?app_id='.$vo['app_id'].'&device_id='.$vo['device_id'].'&settype=1')}" href="javascript:;" title="开启升级提示">开启升级提示</a>-->
<!--                    {/if}-->
                </td>
            </tr>
            {/volist}
            </tbody>
        </table>

        <div id="pages" class="center"></div>

    </form>
</div>

{include file="../../../application/admin/view/public/foot" /}


<script type="text/javascript">
    var curUrl="{:url('ulog/needUpdateDevices',$param)}";
    layui.use(['laypage', 'layer','laydate'], function() {
        var laypage = layui.laypage
                , layer = layui.layer,laydate=layui.laydate;
        laydate.render({
            elem: '#startTime'
            ,type: 'datetime'
        });
        laydate.render({
            elem: '#endTime'
            ,type: 'datetime'
        });
        laypage.render({
            elem: 'pages'
            ,count: {$total}
            ,limit: {$limit}
            ,curr: {$page}
            ,layout: ['count', 'prev', 'page', 'next', 'limit', 'skip']
            ,jump: function(obj,first){
                if(!first){
                    location.href = curUrl.replace('%7Bpage%7D',obj.curr).replace('%7Blimit%7D',obj.limit);
                }
            }
        });
    });
</script>
</body>
</html>